home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / modeler / addmacro.lwm < prev    next >
Text File  |  1993-12-13  |  749b  |  36 lines

  1. /* CMD: Add Macro
  2.  * Add Macro file to list
  3.  */
  4.  
  5. call addlib "LWModelerARexx.port", 0
  6. signal on error
  7. signal on syntax
  8. fullfile=getfilename("-- Add Macro --","/Arexx_Examples/lwm" )
  9. say fullfile
  10. if(fullfile~="(none)") then do
  11.   txt = left(fullfile, length(fullfile) - 4)
  12.   if (open(fil, fullfile, 'r')) then do
  13.     ln = readln(fil)
  14.     say ln
  15.     call close fil
  16.     say txt
  17.     do j = 1 to words(ln)
  18.          if (word(ln, j) = 'CMD:') then do
  19.           txt = subword(ln, j + 1)
  20.         say txt
  21.         end
  22.       end j
  23.     end /* Open */
  24.   say call 'rxcmd_add' txt fullfile
  25.   call rxcmd_add txt, fullfile
  26.   end
  27. call remlib "LWModelerARexx.port"
  28.  
  29. exit
  30.  
  31.     syntax:
  32.     error:
  33.     t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  34.     call remlib(mxx)
  35.     exit
  36.